package reflect;

import java.lang.reflect.Constructor;

/**
 * 使用指定构造器
 */
public class ReflectDemo3 {
    public static void main(String[] args) throws Exception{
        Class cls = Class.forName("reflect.Person");
        System.out.println(cls);

        Constructor c = cls.getConstructor(String.class,int.class);
        Object obj = c.newInstance("liu", 123);
        System.out.println(obj);
    }
}
